# -*- coding: utf-8 -*-
# from django.test import TestCase

# Create your tests here.
import json
import urllib.parse, urllib.request

#
# s = urllib.parse.urlencode({
#     'opt': 1
# })
# print(s)
# url_change = urllib.parse.urlparse('https://i.cnblogs.com/EditPosts.aspx?%s' % s)
# print(url_change.query)
# lst_query = dict(urllib.parse.parse_qsl(url_change.query))
# dict_query = urllib.parse.parse_qs(url_change.query)
# print(lst_query)
# print(dict_query)
from datetime import datetime

response = urllib.request.urlopen(
    "https://oauth.cloud.sh.edu.cn/oauth/GetAccessToken?client_id=d368c3bc170b3b07&code=code183ea40cdcad4dd3b35e085c2d2204e1&client_secret=fc90f147876303c26f3962c74f7bfc05")
s = json.loads(response.read().decode("utf-8"))
print(s.get('type'))
print(dict(s))
print(str(datetime.now()))
